import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import Register from '@/views/Register'
import Home from '@/views/Home'
Vue.use(VueRouter)
const routes=[
    {
        path:'/login',
        component:Login
    },
    {
        path:'/register',
        component:Register,
    },
    {
        path:'/',
        redirect:'/home' //当用户首页项目根路径，重定向/home
    },
    {
        path:'/home',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('@/views/ShortNav.vue')
            },
            {
                path:'studentsList',
                component:()=>import('@/views/student/StudentList')
            },
            {
                path:'studentsAdd',
                component:()=>import('@/views/student/StudentAdd')
            },
            {
                path:'classesList',
                component:()=>import('@/views/classes/ClassesList')
            },
            {
                path:'classesAdd',
                component:()=>import('@/views/classes/ClassesAdd')
            }
        ]
    }
]
const router=new VueRouter({
    routes
})
export default router